﻿<gui:OptionPanel x:Class="ICSharpCode.SharpDevelop.Gui.OptionPanels.LoadSaveOptions"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:core="http://icsharpcode.net/sharpdevelop/core"
                 xmlns:sd="clr-namespace:ICSharpCode.SharpDevelop"
                 xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui"
                 xmlns:widgets="http://icsharpcode.net/sharpdevelop/widgets"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:local="clr-namespace:ICSharpCode.SharpDevelop.Gui.OptionPanels">
	<StackPanel>
		<GroupBox Header="{core:Localize Dialog.Options.IDEOptions.LoadSaveOptions.LoadLabel}">
			<widgets:StackPanelWithSpacing SpaceBetweenItems="5">
				<CheckBox Content="{core:Localize Dialog.Options.IDEOptions.LoadSaveOptions.LoadUserDataCheckBox}"
				          IsChecked="{core:OptionBinding gui:WpfWorkbench.LoadDocumentProperties}" />
				<CheckBox Name="detectExternalChanges"
				          Content="{core:Localize Dialog.Options.IDEOptions.LoadSaveOptions.DetectExternalChanges}"
				          IsChecked="{core:OptionBinding sd:FileChangeWatcher.DetectExternalChangesOption}" />
				<CheckBox Content="{core:Localize Dialog.Options.IDEOptions.LoadSaveOptions.AutoLoadExternalChanges}"
				          Margin="18,0,0,0"
				          IsEnabled="{Binding IsChecked, ElementName=detectExternalChanges}"
				          IsChecked="{core:OptionBinding sd:FileChangeWatcher.AutoLoadExternalChangesOption}" />
			</widgets:StackPanelWithSpacing>
		</GroupBox>
		<GroupBox Header="{core:Localize Dialog.Options.IDEOptions.LoadSaveOptions.SaveLabel}">
			<StackPanel>
				<CheckBox Content="{core:Localize Dialog.Options.IDEOptions.LoadSaveOptions.CreateBackupCopyCheckBox}"
				          IsChecked="{core:OptionBinding sd:FileService.SaveUsingTemporaryFile}" />
				<Label
					Content="{core:Localize Dialog.Options.IDEOptions.LoadSaveOptions.DefaultFileEncoding}"
					Target="{Binding ElementName=encodingComboBox}" />
				<ComboBox
					Name="encodingComboBox"
					Margin="18,0,4,0"
					ItemsSource="{x:Static sd:FileService.AllEncodings}"
					SelectedItem="{core:OptionBinding sd:FileService.DefaultFileEncoding}">
					<ComboBox.ItemTemplate>
						<DataTemplate>
							<TextBlock Text="{Binding DisplayName}" />
						</DataTemplate>
					</ComboBox.ItemTemplate>
				</ComboBox>
			</StackPanel>
		</GroupBox>
		<GroupBox Header="{core:Localize Global.Delete}">
			<CheckBox Content="{core:Localize Dialog.Options.IDEOptions.LoadSaveOptions.UseRecycleBin}"
			          IsChecked="{core:OptionBinding sd:FileService.DeleteToRecycleBin}" />
		</GroupBox>
	</StackPanel>
</gui:OptionPanel>